home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh -f
-
- #
- # brute force cleaning up user www environment
- # use it with caution
- #
-
- set path = (/usr/bsd /bin /usr/bin /usr/sbin /usr/bin/X11)
- setenv DT_utilities `dirname $0`
- pushd $DT_utilities >& /dev/null
- setenv DT_utilities `pwd`
- popd >& /dev/null
- setenv CDROM_ROOT `dirname $DT_utilities`
- set DT_xconfirm = "$DT_utilities/DT_xconfirm"
-
- set path = (${DT_util_path} $path)
- set userName = $HOME
-
- # verify this is a DT CD
- if (! -d $CDROM_ROOT/toolbox) then
- $DT_xconfirm notviewDT
- exit 0
- endif
-
- set DATA=$CDROM_ROOT/.DT_Data
- if (-f $DATA) then
- set DT_WWW_ROOT = "`head -1 $DATA`"
- else
- set IM_FILE = $CDROM_ROOT/.IM
- if (-f $IM_FILE) then
- if ($CD_ID == 57 || $CD_ID == 58 || $CD_ID == 59 ) then
- $DT_xconfirm error "Not Developer Toolbox 6.0 or later"
- set DT_WWW_ROOT = ".www_6.0"
- else if ($CD_ID == 221 || $CD_ID == 222 || $CD_ID == 223 ) then
- set DT_WWW_ROOT = ".www_fcd96"
- else
- $DT_xconfirm error "Not Developer Toolbox 6.0 or later"
- endif
- else
- $DT_xconfirm error "Not Developer Toolbox 6.0 or later"
- endif
- endif
-
- set port = `cat $userName/$DT_WWW_ROOT/logs/httpd.port`
-
- #stop http server
- if (-e $userName/$DT_WWW_ROOT/logs/httpd.pid) then
- echo "Killing http server [pid] = `cat $userName/$DT_WWW_ROOT/logs/httpd.pid`"
- kill -9 `cat $userName/$DT_WWW_ROOT/logs/httpd.pid`
- endif
-
- #stop ok server
- if (-e $userHome/$DT_WWW_ROOT/logs/oksrv.port) then
- if (! -d $CDROM_ROOT/toolbox) then
- $DT_xconfirm notviewDT
- exit 0
- endif
- setenv OKSVR_PORT `cat $userHome/$DT_WWW_ROOT/logs/oksrv.port`
- echo "stopping OK server "
- okserver stop
- endif
-
- if ( -e /tmp/.userhome_$port) /usr/bin/rm -f /tmp/.userhome_$port
- if ( -e /tmp/.cdlocation_$port) /usr/bin/rm -f /tmp/.cdlocation_$port
-
- # in multiuser environment ??
- if ( -e /tmp/.portlock ) /usr/bin/rm -f /tmp/.portlock
-
- echo "removing $userName/$DT_WWW_ROOT"
- if ("$DT_WWW_ROOT" != "") /usr/bin/rm -rf $userName/$DT_WWW_ROOT
-
- echo " "
- echo "brute force cleanup done"
- echo " "
-
- exit 1
-